package es.javamyadmin.beans;

import java.io.Serializable;
import java.util.Collection;

import es.javamyadmin.modelo.ModelFacade;
import es.javamyadmin.modelo.Tables;

/**
 * Bean para las listas de las tablas
 * @author Emilio Javier Castillo Gonzalez
 * @author Hector Delgado Duran
 *
 */
public class ListaTablesBean implements Serializable{

	
	/**
	 * 
	 */
	private static final long serialVersionUID = 4257985840033715182L;
	private String user = new String();
	private String pass = new String();
	private String host = new String();
	private String port = new String();
	private String database = new String();
	private String table = new String();

	public ListaTablesBean(){
		super();
	}
	


	/**
	 * @return the user
	 */
	public String getUser() {
		return user;
	}



	/**
	 * @param user the user to set
	 */
	public void setUser(String user) {
		this.user = user;
	}



	/**
	 * @return the pass
	 */
	public String getPass() {
		return pass;
	}



	/**
	 * @param pass the pass to set
	 */
	public void setPass(String pass) {
		this.pass = pass;
	}



	/**
	 * @return the host
	 */
	public String getHost() {
		return host;
	}



	/**
	 * @param host the host to set
	 */
	public void setHost(String host) {
		this.host = host;
	}



	/**
	 * @return the port
	 */
	public String getPort() {
		return port;
	}



	/**
	 * @param port the port to set
	 */
	public void setPort(String port) {
		this.port = port;
	}



	/**
	 * @return the database
	 */
	public String getDatabase() {
		return database;
	}



	/**
	 * @param database the database to set
	 */
	public void setDatabase(String database) {
		this.database = database;
	}



	/**
	 * @return the table
	 */
	public String getTable() {
		return table;
	}



	/**
	 * @param table the table to set
	 */
	public void setTable(String table) {
		this.table = table;
	}



	/**
	 * Metodo que obtiene el nombre de las tablas de la base de datos
	 * @return Collection<Tables>
	 */
	public Collection<Tables> getTables(){
		
		Collection<Tables> tables = ModelFacade.getTables(user, pass, host, port, database);
		
		return tables;
	}

	/**
	 * Metodo que obtiene el numero de filas de una tabla
	 * @return Collection<Tables>
	 */
	public Collection<Tables> getNumFilasTables(){
		
		Collection<Tables> tables = ModelFacade.getNumFilasTables(user, pass, host, port, database, table);
		
		return tables;
	}
	
	/**
	 * Metodo que obtiene el detalle de una tabla
	 * @return Collection<Tables>
	 */
	public Collection<Tables> getDescribe(){
		
		Collection<Tables> tables = ModelFacade.getDescribe(user, pass, host, port, database, table);
		
		return tables;
	}
	
	/**
	 * Metodo que obtiene el contenido de una tabla
	 * @return Collection<Tables>
	 */
	public Collection<Tables> getSelect(){
		
		Collection<Tables> tables = ModelFacade.getSelect(user, pass, host, port, database, table);
		System.out.println("Entro en getSelect");
		return tables;
	}
	
}
